﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using jade.content.onto;

namespace Ontology2WSDL
{
    public class OntologyTypeBinder
    {
        Hashtable typesTable = new Hashtable();
        public OntologyTypeBinder()
        {
            typesTable.Add(BasicOntology.STRING,"string");
            typesTable.Add(BasicOntology.FLOAT,"float");
            typesTable.Add(BasicOntology.INTEGER,"int");
            typesTable.Add(BasicOntology.DATE,"date");
            typesTable.Add(BasicOntology.BOOLEAN,"boolean");
            typesTable.Add(BasicOntology.BYTE_SEQUENCE, "byte-sequence");
            //typesTable.Add("sequence", "byte-sequence");
        }

        public string getXMLType(string ontologyType)
        {
            string xmlType = (string)typesTable[ontologyType];
            if (xmlType == null)
            {
                throw new Exception("Unknown ontology type " + ontologyType);
            } else return xmlType;
        }
    }
}
